
m = [3,5]
limit = 999
res = []
for l in m:
    for i in range(1, limit // l + 1):
        res.append(l*i)
l = 15
for i in range(1, limit // l + 1):
    res.append(-1*l*i)
print 'the result is:%d' % sum(res)
